﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Device.Screen
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System.Collections.Generic;
using UnityEngine.Internal;

#nullable disable
namespace UnityEngine.Device
{
  /// <summary>
  ///   <para>Access platform-specific display information.</para>
  /// </summary>
  public static class Screen
  {
    /// <summary>
    ///   <para>This has the same functionality as Screen.autorotateToLandscapeLeft and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static bool autorotateToLandscapeLeft
    {
      get => ShimManager.screenShim.autorotateToLandscapeLeft;
      set => ShimManager.screenShim.autorotateToLandscapeLeft = value;
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.autorotateToLandscapeRight and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static bool autorotateToLandscapeRight
    {
      get => ShimManager.screenShim.autorotateToLandscapeRight;
      set => ShimManager.screenShim.autorotateToLandscapeRight = value;
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.autorotateToPortrait and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static bool autorotateToPortrait
    {
      get => ShimManager.screenShim.autorotateToPortrait;
      set => ShimManager.screenShim.autorotateToPortrait = value;
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.autorotateToPortraitUpsideDown and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static bool autorotateToPortraitUpsideDown
    {
      get => ShimManager.screenShim.autorotateToPortraitUpsideDown;
      set => ShimManager.screenShim.autorotateToPortraitUpsideDown = value;
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.currentResolution and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static Resolution currentResolution => ShimManager.screenShim.currentResolution;

    /// <summary>
    ///   <para>This has the same functionality as Screen.cutouts and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static Rect[] cutouts => ShimManager.screenShim.cutouts;

    /// <summary>
    ///   <para>This has the same functionality as Screen.dpi and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static float dpi => ShimManager.screenShim.dpi;

    /// <summary>
    ///   <para>This has the same functionality as Screen.fullScreen and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static bool fullScreen
    {
      get => ShimManager.screenShim.fullScreen;
      set => ShimManager.screenShim.fullScreen = value;
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.fullScreenMode and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static FullScreenMode fullScreenMode
    {
      get => ShimManager.screenShim.fullScreenMode;
      set => ShimManager.screenShim.fullScreenMode = value;
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.height and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static int height => ShimManager.screenShim.height;

    /// <summary>
    ///   <para>This has the same functionality as Screen.width and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static int width => ShimManager.screenShim.width;

    /// <summary>
    ///   <para>This has the same functionality as Screen.orientation and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static ScreenOrientation orientation
    {
      get => ShimManager.screenShim.orientation;
      set => ShimManager.screenShim.orientation = value;
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.resolutions and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static Resolution[] resolutions => ShimManager.screenShim.resolutions;

    /// <summary>
    ///   <para>This has the same functionality as Screen.safeArea and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    public static Rect safeArea => ShimManager.screenShim.safeArea;

    /// <summary>
    ///   <para>This has the same functionality as Screen.sleepTimeout. At the moment, the Device Simulator doesn't support simulation of this property.</para>
    /// </summary>
    public static int sleepTimeout
    {
      get => ShimManager.screenShim.sleepTimeout;
      set => ShimManager.screenShim.sleepTimeout = value;
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.brightness. At the moment, the Device Simulator doesn't support simulation of this property.</para>
    /// </summary>
    public static float brightness
    {
      get => ShimManager.screenShim.brightness;
      set => ShimManager.screenShim.brightness = value;
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.SetResolution and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    /// <param name="width"></param>
    /// <param name="height"></param>
    /// <param name="fullscreenMode"></param>
    /// <param name="preferredRefreshRate"></param>
    /// <param name="fullscreen"></param>
    public static void SetResolution(
      int width,
      int height,
      FullScreenMode fullscreenMode,
      [DefaultValue("0")] int preferredRefreshRate)
    {
      ShimManager.screenShim.SetResolution(width, height, fullscreenMode, preferredRefreshRate);
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.SetResolution and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    /// <param name="width"></param>
    /// <param name="height"></param>
    /// <param name="fullscreenMode"></param>
    /// <param name="preferredRefreshRate"></param>
    /// <param name="fullscreen"></param>
    public static void SetResolution(int width, int height, FullScreenMode fullscreenMode)
    {
      Screen.SetResolution(width, height, fullscreenMode, 0);
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.SetResolution and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    /// <param name="width"></param>
    /// <param name="height"></param>
    /// <param name="fullscreenMode"></param>
    /// <param name="preferredRefreshRate"></param>
    /// <param name="fullscreen"></param>
    public static void SetResolution(
      int width,
      int height,
      bool fullscreen,
      [DefaultValue("0")] int preferredRefreshRate)
    {
      Screen.SetResolution(width, height, fullscreen ? FullScreenMode.FullScreenWindow : FullScreenMode.Windowed, preferredRefreshRate);
    }

    /// <summary>
    ///   <para>This has the same functionality as Screen.SetResolution and also mimics platform-specific behavior in the Unity Editor.</para>
    /// </summary>
    /// <param name="width"></param>
    /// <param name="height"></param>
    /// <param name="fullscreenMode"></param>
    /// <param name="preferredRefreshRate"></param>
    /// <param name="fullscreen"></param>
    public static void SetResolution(int width, int height, bool fullscreen)
    {
      Screen.SetResolution(width, height, fullscreen, 0);
    }

    /// <summary>
    ///   <para>The Device Simulator doesn't simulate this property.</para>
    /// </summary>
    public static Vector2Int mainWindowPosition => ShimManager.screenShim.mainWindowPosition;

    /// <summary>
    ///   <para>The Device Simulator doesn't simulate this property.</para>
    /// </summary>
    public static DisplayInfo mainWindowDisplayInfo => ShimManager.screenShim.mainWindowDisplayInfo;

    public static void GetDisplayLayout(List<DisplayInfo> displayLayout)
    {
      ShimManager.screenShim.GetDisplayLayout(displayLayout);
    }

    public static AsyncOperation MoveMainWindowTo(in DisplayInfo display, Vector2Int position)
    {
      return ShimManager.screenShim.MoveMainWindowTo(in display, position);
    }
  }
}
